Determine the value returned by the function?
by Merrick '23
def word_length(x):
counter = 0
for i in x:
counter += 1
return counter
Function Call | Return Value | |||
---|---|---|---|---|
word_length("Sunset") | → | |||
word_length("School") | → | |||
word_length("Python") | → | |||
word_length("Mathematics") | → | |||
word_length("Hey") | → |
Experiment with this code on Gitpod.io